﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.IO;
using System.Linq;
using System.Windows;

namespace MissionEditor2
{
	/// <summary>
	/// Interaction logic for App.xaml
	/// </summary>
	public partial class App : Application
	{
#if DEBUG
#else
#endif
		// don't die silently

		string startupFolder;

		private void Application_Startup(object sender, StartupEventArgs e)
		{
			startupFolder = Directory.GetCurrentDirectory();
		}

		private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
		{
			//var exception = e.Exception;
			//var text = exception.GetType().Name + "\r\n" + exception.Message + "\r\n" + exception.StackTrace;
			//File.AppendAllText(startupFolder + "\\errors.log", text + "\n");
			//var message = String.Format("{0} error.\r\n{1}\r\nSee {2}\\errors.log for details.\r\n", (exception.GetType().Name), exception.Message,
			//                        startupFolder);
			//MessageBox.Show(message);
			//Environment.Exit(1);
		}
	}
}
